project(AlignViewer)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake_modules/")
Include (CheckCXXSourceCompiles)
find_package(Qt4 REQUIRED)
find_package(INDI REQUIRED)
find_package(Nova REQUIRED)
find_package(ZLIB REQUIRED)

set(MOUNTDISPLAY_INCLUDE_DIR "../Pad/")
set(MountDisplay_SRCS  ../Pad/MountDisplay.cpp)
set(MountDisplay_FORMS ../Pad/MountDisplay.ui)
set(MountDisplay_HEADERS ../Pad/MountDisplay.h)

include_directories(${QT_INCLUDES} ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${INDI_INCLUDE_DIR} ${NOVA_INCLUDE_DIR} ${MOUNTDISPLAY_INCLUDE_DIR})

set(AlignViewer_SRCS AlignViewer.cpp main.cpp)
set(AlignViewer_FORMS AlignViewer.ui)
set(AlignViewer_HEADERS  AlignViewer.h)
#set(PolarAlign_RESOURCES ../Pad/res_pad.qrc)

qt4_wrap_cpp(AlignViewer_HEADERS_MOC ${AlignViewer_HEADERS} ${MountDisplay_HEADERS})
qt4_wrap_ui(AlignViewer_FORMS_HEADERS ${AlignViewer_FORMS} ${MountDisplay_FORMS})
#qt4_add_resources(PolarAlign_RESOURCES_RCC ${PolarAlign_RESOURCES})

add_executable(AlignViewer ${AlignViewer_SRCS} ${MountDisplay_SRCS} ${AlignViewer_HEADERS_MOC} ${AlignViewer_FORMS_HEADERS} ) #${PolarAlign_RESOURCES_RCC}))
target_link_libraries(AlignViewer ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${INDI_LIBRARIES} ${INDI_CLIENT_LIBRARIES} ${NOVA_LIBRARIES} ${ZLIB_LIBRARY})
install(TARGETS AlignViewer RUNTIME DESTINATION bin)
